﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SGTLightAccent.Models;


namespace SGTLightAccent.Views
{
    public partial class Admin : UserControl
    {
        public Admin()
        {
            InitializeComponent();
        }
        private void _grid_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            IEnumerable<UIElement> elementsUnderMouse =
                VisualTreeHelper
                    .FindElementsInHostCoordinates(e.GetPosition(null), this);
            DataGridRow row =
                elementsUnderMouse
                    .Where(uie => uie is DataGridRow)
                    .Cast<DataGridRow>()
                    .FirstOrDefault();
            if (row != null)
                dataGrid1.SelectedItem = row.DataContext;
        }
       
    }
}
